/**
 * 文章列表相关
 * 包括列表/详情
 */
const router = require('koa-router')();
const App = require("../controllers/app");
const Post = require("../controllers/post");

router.prefix('/post')
//渲染主页
router.get('/',Post.showPost);
//渲染我的发帖
router.get("/mypost",Post.showMyPost);
//发帖
router.post("/post",App.verifyToken,App.hasBody,Post.post)
//获取我的发帖
router.get("/getmypost",Post.getMyPost);
//删除我的发帖
router.post("/delete",App.hasBody,Post.delete);
//评论
router.post("/comment",App.verifyToken,App.hasBody,Post.saveComment);
//点赞
router.post("/like",App.verifyToken,App.hasBody,Post.like)
module.exports = router